package com.cd.learn.cdlearn.pattern.command;

public class Client {


    public static void main(String[] args) {
        //命令的参数，或者执行命令的内容
        CommandParam commandCaller = new CommandParam();
        commandCaller.setCommandReceive("西红柿鸡蛋面",1);
        commandCaller.setCommandReceive("可乐",2);
        //命令的执行者
        CommandReceive commandReceive = new CommandReceive();
        //生成具体命令对象
        Command orderFood = new OrderFood(commandReceive, commandCaller);

        //命令调用者
        Water water = new Water();
        //把命令传递给命令调用者
        water.setCommands(orderFood);
        //调用命令
        water.orderUp();
    }
}
